package com.example.animation;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


       /*
       gif
       */
       /* ImageView mlmageAnim = findViewById(R.id.image_anim);
        Button startbutton = findViewById(R.id.but_strat);
        Button stopbutton = findViewById(R.id.but_stop);
        AnimationDrawable anim = (AnimationDrawable) mlmageAnim.getBackground();
        startbutton.setOnClickListener(view -> {
            anim.start();
        });
        stopbutton.setOnClickListener(view -> {
            anim.stop();
        });*/

        initview();
    }
    private  void initview(){
        //ImageView alphaanim = findViewById(R.id.image_anim);
       // ImageView alphaanim1 = findViewById(R.id.image_anim1);
      //  ImageView alphaanim2 = findViewById(R.id.image_anim2);
        ImageView shizhen = findViewById(R.id.shizhen);
       ImageView fenzhen = findViewById(R.id.fenzhen);
        ImageView miaozhen = findViewById(R.id.miaozhen);


       // Animation alphaAnimation =
              //  (Animation) AnimationUtils.loadAnimation(this,R.anim.anim_alpha);
       // alphaanim.setAnimation(alphaAnimation);

       // alphaanim1.setAnimation(AnimationUtils.loadAnimation(this,R.anim.anim_scale));
       // alphaanim2.setAnimation(AnimationUtils.loadAnimation(this,R.anim.anim_tran));
        shizhen.setAnimation(AnimationUtils.loadAnimation(this,R.anim.anim_rotate));
        fenzhen.setAnimation(AnimationUtils.loadAnimation(this,R.anim.anim_rotate_fenzhen));
        miaozhen.setAnimation(AnimationUtils.loadAnimation(this,R.anim.anim_rotate_miaozhen));


    }
}